{template '_header'}
<div class="page-heading"> <h2>基础设置</div>

<form id="setform"  action="" method="post" class="form-horizontal form-validate">
    <div class="form-group">
        <label class="col-sm-2 control-label">话题上传图片限制</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sns.set.edit'}
            <input type="text" name="data[imagesnum]" class="form-control" value="{$data['imagesnum']}"  />
            <span class="help-block">如果不填写或为0，默认上传5张</span>
            {else}
            <div class='form-control-static'>{$data['imagesnum']}</div>
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">超级管理员</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sns.set.edit'}
            {php echo tpl_selector('managers',array('key'=>'openid','text'=>'nickname', 'thumb'=>'avatar','multi'=>1,'placeholder'=>'昵称/姓名/手机号','buttontext'=>'选择会员', 'items'=>$managers,'url'=>webUrl('member/query') ))}
            <span class='help-block'>选择的会员拥有所有版块的删除，置顶，精华，审核，发帖免审等所有权限</span>

            {else}
            <div class="input-group multi-img-details" id='saler_container'>
                {loop $managers $manager}
                <div class="multi-item saler-item" openid='{$manager['openid']}'>
                <input type="hidden" value="{$manager['managers']}" name="managers[]">
                <img class="img-responsive img-thumbnail" src='{$manager['avatar']}' onerror="this.src='./resource/images/nopic.jpg'; this.title='图片未找到.'">
                <div class='img-nickname'>{$manager['nickname']}</div>
                <input type="hidden" value="{$manager['managers']}" name="managers[]">
            </div>
            {/loop}
        </div>
        {/if}
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">默认版块Banner</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sns.set.edit'}
            {php echo tpl_form_field_image('data[banner]', empty($data['banner'])?'../addons/ewei_shopv2/plugin/sns/static/images/banner.png':$data['banner'])}
            <span class='help-block'>建议尺寸:640 * 320,版块可以单独设置</span>
            {else}
            {if !empty($data['banner'])}
            <a href='{php echo tomedia($data['banner'])}' target='_blank'>
            <img src="{php echo tomedia($data['banner'])}" style='width:100px;border:1px solid #ccc;padding:1px'/>
            </a>
            {/if}
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">会员默认头像</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sns.set.edit'}
            {php echo tpl_form_field_image('data[avatar]', empty($data['avatar'])?'../addons/ewei_shopv2/plugin/sns/static/images/head.jpg':$data['avatar'])}
            <span class='help-block'>W建议尺寸:100 * 100</span>
            {else}
            {if !empty($data['avatar'])}
            <a href='{php echo tomedia($data['avatar'])}' target='_blank'>
            <img src="{php echo tomedia($data['avatar'])}" style='width:100px;border:1px solid #ccc;padding:1px'/>
            </a>
            {/if}
            {/if}
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">会员升级依据</label>
        <div class="col-sm-9">
            {ifp 'sns.set.edit'}
            <label class="radio radio-inline" >
                <input type="radio" name="data[leveltype]" value="0" {if empty($data['leveltype'])}checked{/if}/> 社区积分
            </label>
            <label class="radio radio-inline">
                <input type="radio" name="data[leveltype]" value="1" {if $data['leveltype']==1}checked{/if}/> 话题数
            </label>
            {else}
            <div class='form-control-static'>{if $data['leveltype']}话题数{else}社区积分{/if}</div>
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">发帖未关注提示</label>
        <div class="col-sm-9">
            {ifp 'sns.set.edit'}
            <input type='text' class="form-control" name='data[followtip]' value='{$data['followtip']}' />
            <span  class='help-block'>如果为空默认为“想要和社友互动吗？需要您关注我们的公众号，点击【确定】关注后再来吧~”</span>
            {else}
            <div class='form-control-static'>{$data['followtip']}</div>
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">社区积分说明连接</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'sns.set.edit'}
            <input type="text" name="data[crediturl]" class="form-control" value="{$data['crediturl']}"  />
            <span class="help-block">个人中心积分说明连接</span>
            {else}
            <div class='form-control-static'>{$data['crediturl']}</div>
            {/if}
        </div>
    </div>

    <div class="form-group">
                <label class="col-sm-2 control-label">关注引导页面</label>
                <div class="col-sm-9 col-xs-12">
                          {ifp 'sns.set.edit'}
                    <input type="text" name="data[followurl]" class="form-control" value="{$data['followurl']}"  />
                    <span class="help-block">不填写默认为商城引导页面</span>
                    {else}
                    <div class='form-control-static'>{$data['followurl']}</div>
                    {/if}
                </div>
     </div>

            <div class="form-group">
    <label class="col-sm-2 control-label">分享标题</label>
    <div class="col-sm-9 col-xs-12">
           {ifp 'sns.set.edit'}
        <input type="text" name="data[share_title]" id="share_title" class="form-control" value="{$data['share_title']}" />
        {else}
        <div class='form-control-static'>{$data['share_title']}</div>
        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">分享图标</label>
    <div class="col-sm-9 col-xs-12">
          {ifp 'sns.set.edit'}
        {php echo tpl_form_field_image('data[share_icon]', $data['share_icon'])}
             {else}
                            {if !empty($data['share_icon'])}
                            <a href='{php echo tomedia($data['share_icon'])}' target='_blank'>
                            <img src="{php echo tomedia($data['share_icon'])}" style='width:100px;border:1px solid #ccc;padding:1px' />
                            </a>
                            {/if}
                        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">分享描述</label>
    <div class="col-sm-9 col-xs-12">
             {ifp 'sns.set.edit'}
        			<textarea name="data[share_desc]" class="form-control" >{$data['share_desc']}</textarea>
             {else}
		        <div class='form-control-static'>{$data['share_desc']}</div>
		    {/if}
    </div>
</div>

<div class="form-group">
        <label class="col-sm-2 control-label">模板选择</label>
        <div class="col-sm-9 col-xs-12">
        	{ifp 'sns.set.edit'}
	            <select class='form-control' name='data[style]'>
	                {loop $styles  $style}
	                <option value='{$style}' {if $style==$data['style']}selected{/if}>{$style}</option>
	                {/loop}
	            </select>
            {else}
            	{$data['style']}
            {/if}
        </div>
    </div>

      
         <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-9">
            	{ifp 'sns.set.edit'}
                	<input type="submit" value="提交" class="btn btn-primary"/>
                {/if}
            </div>
 
</form>

{template '_footer'}